<template>
    <view>


        <view class="cu-list menu sm-border card-menu margin-top guoshao-notice" 
		v-for="(item,index) in listData":key="index">
            <view class="cu-item arrow" @click="jumpClick" :data-link="item.link" :data-id="item.id">
                <view class="content">
                    <text class="cu-tag radius bg-red text-white guoshao-top" v-if="item.isTop == 1">置顶</text>
                    <text class="text-black guoshao-font">{{ item.title }}</text>
                </view>
                <view class="action">
                    <text class="text-black text-sm">{{ item.createTime }}</text>
                </view>
            </view>
        </view>

    </view>
</template>

<script>
const http = require('../../../utils/http.js');

export default {
    data() {
        return {
            listData: [],
			pullUpOn:false
        };
    },
    onLoad: function (options) {
        this.notices();
    },
    methods: {
        notices: function () {
            let that = this;
            var params = {
                url: '/notice/notices',
                method: 'GET',
                data: {
                    type: 2
                },
                callBack: function (res) {
                    that.setData({
                        listData: res.data
                    });
                }
            };
            http.request(params);
        },

        jumpClick: function (e) {
            let link = e.currentTarget.dataset.link;
            link = '/pages/notice/notice?id=' + e.currentTarget.dataset.id;
            uni.navigateTo({
                url: link,
                // 指定页面的 url
                success: (res) => {},
                fail: (res) => {}
            });
        }
    }
};
</script>
<style>
@import './notice.css';
</style>
